package com.cyz.admin.controller;

import com.cyz.common.service.UploadService;
import com.cyz.common.utils.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

@RestController
@Api(tags = "管理端上传图片类接口")
public class UploadController {

    @Autowired
    private UploadService uploadService;

    @ApiOperation(value = "上传图片")
    @PostMapping("/upload")
    public R uploadImg(MultipartFile img){
        return uploadService.uploadImg(img);
    }
}